
export const useTableList = () => {
    const operatorColumn = {
        title: "操作",
        width: 90,
        slotName: "operator",
        fixed: "right",
    };
    const inited = ref(false);
    // 加载状态
    const loading = ref(false);
    // 搜索条件
    const dataFilter = reactive({
        current: 1, // 当前页
        size: 10, // 每页条数
    } as any);
    // 列表分页信息
    const pagination = reactive({
        total: 0,
        current: 1,
        pageSize: 10,
        showPageSize: true,
        showTotal: true,
        showJumper: true
    });
    const rowSelection = reactive({
        type: 'checkbox',
        showCheckedAll: true,
        onlyCurrent: false,
    });
    // 筛选窗显示状态
    const filterVisible = ref(false);
    // 选中的文章id
    const selectedKeys = ref([]);

    // // 监听列表分页大小或者页码变化 
    // watch([pagination.current, pagination.pageSize], () => {
    //     dataFilter.current = pagination.current;
    //     dataFilter.size = pagination.pageSize;
    // });

    return {
        inited,
        loading,
        dataFilter,
        filterVisible,
        pagination,
        selectedKeys,
        rowSelection,
        operatorColumn,
    }
}